package com.tinem.platform.module.starter.jms.consumer;

import java.util.Set;

/**
 * @author fengzhihao
 * @version v1
 * @program: platform
 * @className ConsumerService
 * @description TODO
 * @site
 * @company
 * @create 2021/12/1 10:27:29
 */
public interface ConsumerService<T> {
    /**
     * 订阅消息
     * @param topic 需要订阅的topic
     * @param subscribeListener 收到消息的处理
     * @return 链接id
     */
    String subscribeTopic(String topic, SubscribeListener<T> subscribeListener);

    /**
     * 取消订阅并释放链接
     * @param connectionId
     */
    void cancelSubscribeTopic(Set<String> connectionId);
}
